# $Id$
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=vice
pkgver=3.1
pkgrel=1
pkgdesc="The Versatile Commodore 8-bit Emulator"
arch=('i686' 'x86_64')
license=('GPL')
url="http://vice-emu.sourceforge.net/"
depends=('gtk3' 'libpulse' 'giflib')
makedepends=('xorg-bdftopcf' 'xorg-mkfontdir' 'libpcap' 'libxaw' 'ffmpeg')
source=("http://downloads.sourceforge.net/project/vice-emu/releases/${pkgname}-${pkgver}.tar.gz"
        'disable-fc-cache.patch')
sha256sums=('3eb8159633816095006dec36c5c3edd055a87fd8bda193a1194a6801685d1240'
            '8058210e092c4943a55baeff47e6d5f3661aeb3686fd1f75e07f47888da9cc98')

prepare() {
  cd ${pkgname}-${pkgver}
  rm -rf src/lib/{liblame,libx264,libffmpeg}

  patch -p1 -i "$srcdir/disable-fc-cache.patch"
  sed -i 's/lib64/lib/g' configure.ac
  autoreconf -fi
}

build() {
  cd ${pkgname}-${pkgver}

  ./configure --prefix=/usr \
    --libdir=/usr/lib \
    --enable-gnomeui3 \
    --enable-external-ffmpeg
  make
}

package() {
  cd ${pkgname}-${pkgver}

  make DESTDIR="${pkgdir}" realdocdir="/usr/share/doc/vice" install -j1
  ln -s /usr/share/doc/vice "${pkgdir}/usr/lib/vice/doc"
}
